
#include "RenderApp/TestApp.h"

int WINAPI WinMain(__in HINSTANCE hInstance, __in_opt HINSTANCE /*hPrevInstance*/, __in LPSTR /*lpCmdLine*/, __in int /*nShowCmd*/)
{
	RenderDevicePtr renderDevice = std::make_shared<RenderDevice>();
	RenderDeviceDesc renderDeviceParam;
	renderDeviceParam.dirverType = D3D_DRIVER_TYPE_HARDWARE;
	renderDeviceParam.deviceFlags = D3D11_CREATE_DEVICE_DEBUG;
	if (!renderDevice->init(renderDeviceParam)) return 0;

	Win32WindowPtr window = std::make_shared<Win32Window>();
	if (!window->init(hInstance, 1000, 600)) return 0;

	ApplicationPtr app = std::make_shared<TestApp>();
	if (!app->init(renderDevice, window->hwnd(), 
		(float)window->width(), (float)window->height())) return 0;
	
	window->set_app(app);

	return window->run();
}